<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>父组件向子组件穿传递数据</title>
</head>

<body>
    <pre>
      父组件向子组件绑定数据时候 直接在模板上用v-bind绑定事件，在子组件中用props接收

    </pre>
    <div class="app">
        <div>{{pmsg}}</div>
        <hello-vue v-bind:title="ptitle" content='hello'></hello-vue>
    </div>

    <script src="./js/vue.js"></script>
    <script>
        Vue.component('hello-vue', {
            props: ['title', 'content'],
            data: function () {
                return {
                    msg: '我是子组件自带的',
                }
            },
            template: `
            <div>
                <p>{{msg}}</p>
                <p>{{msg + '----' + title + '---' + content }}</p>
            </div>
            `
        })
        var xm = new Vue({
            el: '.app',
            data: {
                pmsg: '我是父组件自带的',
                ptitle: '哈哈，我是父组件绑定给子组件的'

            }
        })



    </script>

</body>

</html>